<style>
    #VIEW-login {
        height: 100%;
        background: #252834;
        padding-top: 1px;
        margin-top: -1px;
    }

    #VIEW-login .layui-logo {
        user-select: none;
        overflow: hidden;
        position: static;
        font-size: 30px;
        color: #d6e0f6;
        width: 100%;
        padding: 0;
        line-height: 120px;
        height: 120px;
        color: #3491ff;
        font-family: "Trebuchet MS", Arial, Helvetica, sans-serif;
        transition: height .8s cubic-bezier(0.075, 0.82, 0.165, 1);
    }

    #VIEW-login .layui-logo span {
        font-weight: normal;
        color: #fff;
        border-bottom: 1px solid #3491ff;
    }

    #VIEW-login .layui-logo span b {
        color: #3491ff;
    }

    #VIEW-login .login-wrap {
        position: relative;
        top: 50%;
        margin-top: -290px;
        height: 540px;
    }

    #VIEW-login .layui-form {
        overflow: hidden;
        background: #fff;
        padding: 40px;
        padding-bottom: 20px;
        border-radius: 0px;
        box-shadow: 0 0 30px #000;
        position: relative;
    }

    #VIEW-login .layui-form-item {
        position: relative;
    }

    #VIEW-login .verify-block {
        display: none;
    }

    #VIEW-login .layui-input {
        text-indent: 26px;
    }


    #VIEW-login .houseimg img {
        display: inline-block;
        margin-top: 5%;
    }

    #VIEW-login .login-type-tab {
        margin-bottom: 20px;
        overflow: hidden;
    }

    #VIEW-login .login-type-tab li {
        display: inline-block;
        padding-right: 20px;
        font-size: 16px;
        line-height: 30px;
        color: #bbb;
        transition: color .5s ease;
    }

    #VIEW-login .layui-form-item .label-icon {
        position: absolute;
        top: 0;
        left: 0;
        width: 38px;
        line-height: 38px;
        text-align: center;
        color: #d2d2d2 !important;
    }

</style>
<div id="VIEW-login" lay-title="登录">
    <div class="login-wrap">
        <div class="layui-container">
            <div class="layui-row">
                <div class="layui-col-xs12 layui-col-lg4 layui-col-lg-offset4 nepadmin-tc">
                    <div class="layui-logo"><span>Ne<b>pA</b>dmin</span></div>
                </div>
                <div class="layui-col-xs12 layui-col-lg4 layui-col-lg-offset4">
                    <div class="layui-form" lay-filter="login-form">
                        <ul class="login-type-tab">
                            <li  >修改密码</li>
                        </ul>

                        <div class="layui-form-item">
                            <label class="layui-icon label-icon layui-icon-username"></label>
                            <input type="text" name="userPassword" lay-verify="required" lay-verType="tips"
                                   placeholder="新密码" maxlength="11" autocomplete="off" class="layui-input">
                        </div>
                        <div class="layui-form-item password-block">
                            <label class="layui-icon label-icon layui-icon-password"></label>
                            <input type="password" name="resetPassword" lay-verify="required" lay-verType="tips"
                                   placeholder="重置密码" autocomplete="off" class="layui-input">
                        </div>

                        <div class="normal-login-form">

                            <div class="layui-form-item">
                                <button class="layui-btn layui-btn-normal layui-btn-fluid" lay-submit
                                        lay-filter="login-submit">
                                    <i style="display: none"
                                       class="layui-icon layui-icon-loading layui-icon layui-anim layui-anim-rotate layui-anim-loop"></i>
                                    立即修改
                                </button>
                            </div>

                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>

<script>
    layui.use(['jquery', 'api','admin', 'form','layer'], function () {
        var $ = layui.jquery
            , layer = layui.layer
            , api = layui.api
            , laydate = layui.laydate
            , form = layui.form
            , admin = layui.admin;

        var router = layui.router();
        var userId = router.search.userId;
        var sid = router.search.sid;

        form.render(null, 'form-group');

        /* 监听提交 */
        form.on('submit(login-submit)', function (data) {
            var field = data.field;
            // 保证两次密码输入一致
            var url = "/sysUser/resetPassword?_method=PUT";
            admin.post({
                url:url,
                data:{userId:userId, userPassword:field.userPassword, sid:sid},
                success:function(res){
                    if (res.code == 0){
                        // 提醒保存成功，关闭当前弹窗
                        layer.msg(res.msg);
                        layer.closeAll();
                        //跳转至登录页面
                        var href = '#/user/login';
                        admin.navigate(href)
                    } else {
                        layer.msg(res.msg);
                    }
                }
            });
            return false;
        });
    });
</script>